<?php
// +---------------------------------------------------------------------+
// | OneBase    | [ WE CAN DO IT JUST THINK ]                            |
// +---------------------------------------------------------------------+
// | Licensed   | http://www.apache.org/licenses/LICENSE-2.0 )           |
// +---------------------------------------------------------------------+
// | Author     | Bigotry <3162875@qq.com>                               |
// +---------------------------------------------------------------------+
// | Repository | https://gitee.com/Bigotry/OneBase                      |
// +---------------------------------------------------------------------+

namespace app\admin\controller;

/**
 * 任务管理控制器
 */
class Task extends AdminBase
{
    
    /**
     * 任务列表
     */
    public function taskList()
    {
        
        $this->assign('list', $this->logicTask->getTaskList());
        
        return $this->fetch('task_list');
    }
    
    /**
     * 任务添加
     */
    public function taskAdd()
    {
        
        IS_POST && $this->jump($this->logicTask->taskEdit($this->param));
        
        return $this->fetch('task_edit');
    }
    
    /**
     * 任务编辑
     */
    public function blogrollEdit()
    {
        
        IS_POST && $this->jump($this->logicTask->taskEdit($this->param));
        
        $info = $this->logicTask->getTaskInfo(['id' => $this->param['id']]);
        
        $this->assign('info', $info);
        
        return $this->fetch('task_edit');
    }
     /**
     * 任务导出
     */
    public function exporttasklist()
    {
        
        $where = $this->logicTask->getWhere($this->param);
        
        $this->logicTask->exportTaskList($where);
    }
    /**
     * 数据状态设置
     */
    public function setStatus()
    {
        
        $this->jump($this->logicAdminBase->setStatus('Task', $this->param));
    }

    /**
     * 任务删除
     */
    public function taskDel($id = 0)
    {
        
        $this->jump($this->logicTask->taskDel(['id' => $id]));
    }
}
